/*
UpdateAgencyPlanOwnerAndAM12MonthRolling
Version 1.0
Description: Trigger for updating Agency_Plan__c records when Account is updated, trigger calls 
             AgencyPlanUpdate_On_AccountUpdate class which contains bussiness logic. 
Author: Pratibh Prakash
Created Date: 9 Mar-2009
*/
trigger UpdateAgencyPlanOwnerAndAM12MonthRolling on Account (after update) {
    
     Map<Id, Account> newAccounts = new Map<Id, Account>();
     Map<Id, Account> oldAccounts = new Map<Id, Account>();
     
     for (Integer i = 0; i < Trigger.old.size(); i++){
        if((Trigger.new[i].OwnerId != Trigger.old[i].OwnerId)||
                (Trigger.new[i].RU_PL_Actual_PY__c != Trigger.old[i].RU_PL_Actual_PY__c)||
                (Trigger.new[i].PL_Actual_PY__c != Trigger.old[i].PL_Actual_PY__c)||
                (Trigger.new[i].RU_CL_Actual_PY__c != Trigger.old[i].RU_CL_Actual_PY__c)||
                (Trigger.new[i].CL_Actual_PY__c != Trigger.old[i].CL_Actual_PY__c)){
            newAccounts.put(Trigger.new[i].Id, Trigger.new[i]);         
        }
     }
}